Fix x86_64 CPU hotplug by paravirtualizing the play_dead() function.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 8 Feb 2006 23:27:52 +0000 (00:27 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 8 Feb 2006 23:27:52 +0000 (00:27 +0100)
Also fix the i386 play_dead() function to call idle_task_exit(),
which ensures the CPU exits while running the init_mm. Otherwise
other tasks may get stuck.

Signed-off-by: Ryan Grimm <grimm@us.ibm.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
buildconfigs/linux-defconfig_xenU_x86_64
buildconfigs/linux-defconfig_xen_x86_64
linux-2.6-xen-sparse/arch/i386/kernel/process-xen.c
linux-2.6-xen-sparse/arch/x86_64/kernel/process-xen.c

index 288c99616923cadbf2937bc1c9dd57968633c17a..e2cd16bf931edcddb98b58a6c838326a5bee2406 100644 (file)
@@ -127,7 +127,7 @@ CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4096
 CONFIG_NR_CPUS=8
-# CONFIG_HOTPLUG_CPU is not set
+CONFIG_HOTPLUG_CPU=y
 CONFIG_SWIOTLB=y
 # CONFIG_CRASH_DUMP is not set
 CONFIG_PHYSICAL_START=0x100000
index 58f18657c86f8030d7591df7888930143965fac5..1f4a66a89b4f8b54adc1fd4a87f20c1f7d14c5f4 100644 (file)
@@ -130,7 +130,7 @@ CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4096
 CONFIG_NR_CPUS=8
-# CONFIG_HOTPLUG_CPU is not set
+CONFIG_HOTPLUG_CPU=y
 CONFIG_SWIOTLB=y
 # CONFIG_CRASH_DUMP is not set
 CONFIG_PHYSICAL_START=0x100000
index 66fbe21e5a6465fbdeb9dc22eb2351ab1733d0d9..a6f5ac0bd2b9ac24a499ed364d24732ced8d5936 100644 (file)
@@ -126,6 +126,7 @@ EXPORT_SYMBOL(default_idle);
 #ifdef CONFIG_HOTPLUG_CPU
 static inline void play_dead(void)
 {
+       idle_task_exit();
        HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL);
        local_irq_enable();
 }
index 15671852d22c52f4f0a65b463b27a60f03c3612c..096aab6eef69b42724edde41a7194db41168dfb4 100644 (file)
@@ -53,6 +53,7 @@
 #include <asm/kdebug.h>
 #include <xen/interface/dom0_ops.h>
 #include <xen/interface/physdev.h>
+#include <xen/interface/vcpu.h>
 #include <asm/desc.h>
 #include <asm/proto.h>
 #include <asm/hardirq.h>
@@ -144,21 +145,7 @@ DECLARE_PER_CPU(int, cpu_state);
 static inline void play_dead(void)
 {
        idle_task_exit();
-       wbinvd();
-       mb();
-       /* Ack it */
-       __get_cpu_var(cpu_state) = CPU_DEAD;
-
-       /* We shouldn't have to disable interrupts while dead, but
-        * some interrupts just don't seem to go away, and this makes
-        * it "work" for testing purposes. */
-       /* Death loop */
-       while (__get_cpu_var(cpu_state) != CPU_UP_PREPARE)
-               HYPERVISOR_sched_op(SCHEDOP_yield, 0);
-
-       local_irq_disable();
-       __flush_tlb_all();
-       cpu_set(smp_processor_id(), cpu_online_map);
+       HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL);
        local_irq_enable();
 }
 #else